/*******************************************************************************
 * Copyright 2011 Google Inc. All Rights Reserved.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *******************************************************************************/
package com.lvc.fotolivro.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RadioButton;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TabPanel;
import com.smartgwt.client.widgets.Img;
import com.smartgwt.client.widgets.Slider;
import com.smartgwt.client.widgets.layout.HStack;
import com.google.gwt.user.client.ui.ScrollPanel;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 * Tela principal, onde o fotolivro será criado e editado.
 *  
 * @author Larissa Nepomuceno Costa
 * @version 1
 * @since 08/10/2012
 */
public class _2 implements EntryPoint {
	public void onModuleLoad() {
		RootPanel rootPanel = RootPanel.get();
		rootPanel.setSize("1063", "606");
		rootPanel.setStyleName("body");
		
		AbsolutePanel absolutePanel_1 = new AbsolutePanel();
		absolutePanel_1.setStyleName("body");
		rootPanel.add(absolutePanel_1, 0, 0);
		absolutePanel_1.setSize("985px", "704px");
		
		AbsolutePanel absolutePanel_2 = new AbsolutePanel();
		absolutePanel_2.setStyleName("body");
		absolutePanel_1.add(absolutePanel_2, 10, 76);
		absolutePanel_2.setSize("965px", "461px");
		
		Page pagina_1 = new Page();
		// ((panel.largura - larguraEntrePaginas) / 2 - pagina.largura 
		Integer posicao1 = ((965 - 3) / 2) - pagina_1.getWidth(); 
		absolutePanel_2.add(pagina_1, posicao1, 25);
		
		Page pagina_2 = new Page();
		// ((panel.largura - larguraEntrePaginas) / 2
		Integer posicao2 = (965  / 2);
		absolutePanel_2.add(pagina_2, posicao2, 25);
		
		AbsolutePanel absolutePanel_10 = new AbsolutePanel();
		absolutePanel_2.add(absolutePanel_10, 407, 425);
		absolutePanel_10.setSize("151px", "26px");
		
		Image image_3 = new Image(GWT.getHostPageBaseURL() +"com.lvc.fotolivro.ImageViewer/sc/skins/Enterprise/images/headerIcons/arrow_left_Over.png");
		absolutePanel_10.add(image_3, 4, 6);
		image_3.setSize("14px", "14px");
		
		Label lblEscolhaOlbum = new Label("Página 2/10");
		absolutePanel_10.add(lblEscolhaOlbum, 22, 4);
		lblEscolhaOlbum.setSize("105px", "17px");
		lblEscolhaOlbum.setStyleName("textoGeral");
		
		Image image_4 = new Image(GWT.getHostPageBaseURL() +"com.lvc.fotolivro.ImageViewer/sc/skins/Enterprise/images/headerIcons/arrow_right_Over.png");
		absolutePanel_10.add(image_4, 131, 5);
		image_4.setSize("15px", "15px");
		
		AbsolutePanel absolutePanel_3 = new AbsolutePanel();
		absolutePanel_1.add(absolutePanel_3, 10, 10);
		absolutePanel_3.setStyleName("faixaDeFundoEstreita");
		absolutePanel_3.setSize("965px", "60px");
		
		AbsolutePanel absolutePanel = new AbsolutePanel();
		absolutePanel_3.add(absolutePanel, 6, 3);
		absolutePanel.setStyleName("faixaDeFundo");
		absolutePanel.setSize("953px", "53px");
		
		Label lblFotolivro = new Label("FotoLivro");
		absolutePanel.add(lblFotolivro, 422, -11);
		lblFotolivro.setStyleName("tituloGrande");
		
		TabPanel tabPanel = new TabPanel();
		tabPanel.setStyleName("gwt-TabBar");
		absolutePanel_1.add(tabPanel, 10, 543);
		tabPanel.setSize("837px", "149px");
		
		AbsolutePanel absolutePanel_bordas = new AbsolutePanel();
		absolutePanel_bordas.setStyleName("gwt-TabBar .gwt-TabBarFirst");
		tabPanel.add(absolutePanel_bordas, "Bordas", false);
		absolutePanel_bordas.setSize("830px", "3cm");
		
		ScrollPanel scrollPanel_1 = new ScrollPanel();
		absolutePanel_bordas.add(scrollPanel_1);
		scrollPanel_1.setSize("830px", "113px");
		
		HStack hStack_1 = new HStack();
		hStack_1.setSize("829px", "93px");
		hStack_1.setShowDragPlaceHolder(true);
		hStack_1.setLayoutMargin(10);
		hStack_1.setCanAcceptDrop(true);
		hStack_1.setAnimateMembers(true);
		
		Image image_1 = new Image("bordas.jpg");
		hStack_1.addMember(image_1);
		image_1.setSize("600px", "88px");
		scrollPanel_1.setWidget(hStack_1);
		
		AbsolutePanel absolutePanel_9 = new AbsolutePanel();
		absolutePanel_9.setStyleName("fundoClaro");
		tabPanel.add(absolutePanel_9, "Cor de fundo", false);
		absolutePanel_9.setSize("830px", "113px");
		
		AbsolutePanel absolutePanel_11 = new AbsolutePanel();
		absolutePanel_11.setStyleName("fundoClaro");
		tabPanel.add(absolutePanel_11, "Fotos", false);
		absolutePanel_11.setSize("830px", "113px");

		
		MyDragPhoto img_1 = new MyDragPhoto("fotos/praia1.jpg");
		
		MyDragPhoto img_2 = new MyDragPhoto("fotos/praia2.jpg");
		
		MyDragPhoto img_3 = new MyDragPhoto("fotos/praia3.jpg");
		
		MyDragPhoto img_4 = new MyDragPhoto("fotos/praia4.jpg");
		
		MyDragPhoto img_5 = new MyDragPhoto("fotos/praia5.jpg");
		
		MyDragPhoto img_6 = new MyDragPhoto("fotos/praia6.jpg");
		
		MyDragPhoto img_7 = new MyDragPhoto("fotos/praia7.jpg");
		
		MyDragPhoto img_8 = new MyDragPhoto("fotos/cube_yellow.png");
		
		MyDragPhoto img_9 = new MyDragPhoto("fotos/cube_blue.png");
		
		MyDragPhoto img_10 = new MyDragPhoto("fotos/cube_green.png");
		
		ScrollPanel scrollPanel = new ScrollPanel();
		absolutePanel_11.add(scrollPanel, 0, 0);
		scrollPanel.setSize("830px", "113px");
		
		HStack hStack = new HStack();
		hStack.setMemberOverlap(-15);
		hStack.setSize("829px", "93px");
		hStack.setLayoutMargin(5);
		
		hStack.setCanAcceptDrop(true);  
		hStack.setAnimateMembers(true);  
		hStack.setShowDragPlaceHolder(true); 
//		hStack.setDropLineThickness(4);  
		hStack.addMember(img_1);
		hStack.addMember(img_2);
		hStack.addMember(img_3);
		hStack.addMember(img_4);
		hStack.addMember(img_5);
		hStack.addMember(img_6);
		hStack.addMember(img_7);
		hStack.addMember(img_8);
		hStack.addMember(img_9);
		hStack.addMember(img_10);
		scrollPanel.setWidget(hStack);
		
		AbsolutePanel absolutePanel_4 = new AbsolutePanel();
		absolutePanel_4.setStyleName("gwt-TabBar .gwt-TabBarItem");
		tabPanel.add(absolutePanel_4, "Ilustrações", false);
		absolutePanel_4.setSize("830px", "3cm");
		
		AbsolutePanel absolutePanel_6 = new AbsolutePanel();
		absolutePanel_6.setStyleName("fundoClaro");
		absolutePanel_4.add(absolutePanel_6, 0, 0);
		absolutePanel_6.setSize("830px", "113px");
		
		Image image = new Image("ilustracoes.jpg");
		absolutePanel_6.add(image, 10, 10);
		image.setSize("600px", "88px");
		
		AbsolutePanel absolutePanel_5 = new AbsolutePanel();
		tabPanel.add(absolutePanel_5, "Layout", false);
		absolutePanel_5.setSize("830px", "3cm");
		
		AbsolutePanel absolutePanel_8 = new AbsolutePanel();
		absolutePanel_8.setStyleName("fundoClaro");
		absolutePanel_5.add(absolutePanel_8, 0, 0);
		absolutePanel_8.setSize("830px", "113px");
		
		Button btnSalvar = new Button("Salvar");
		btnSalvar.setStyleName("gwt-ButtonLetraVerde");
		absolutePanel_1.add(btnSalvar, 858, 575);
		btnSalvar.setSize("117px", "30px");
	}
}

